import request from '@/utils/request';
import Qs from 'qs';

/**
 * 品控部门修改商品审核状态为拒绝
 * @param data
 */
export const hmProductsRefuse = (data: { id: string }) => {
  return request({
    url: '/electroniccommerce/hmQuality/refuse',
    method: 'post',
    data: data
  });
};

/**
 * 品控部门修改商品审核状态为通过
 * @param data
 */
export const hmProductsPass = (data: { id: string }) => {
  return request({
    url: '/electroniccommerce/hmQuality/pass',
    method: 'post',
    data: data
  });
};

/**
 * 查询品控部意向列表
 * @param
 */
export const getIntentionPage = (query: { pageNum: number, pageSize: number }) => {
  return request({
    url: '/electroniccommerce/anchorSupplierIntention/getIntentionPage',
    method: 'get',
    params: query
  });
};

/**
 * 添加品控部意向
 * @param data
 */
export const anchorSupplierIntention = (data: { productsId?: string }) => {
  return request({
    url: '/electroniccommerce/anchorSupplierIntention',
    method: 'post',
    data: data
  });
};

/**
 * 清空品控部意向
 * @param data
 */
export const clearIntention = () => {
  return request({
    url: '/electroniccommerce/anchorSupplierIntention/clearIntention',
    method: 'delete',
  });
};

/**
 * 获取部门列表
 * @param 
 */
export const getDeptList = (query: { parentId?: string }) => {
  return request({
    url: '/system/dept/queryList',
    method: 'get',
    params: query
  });
};

/**
 * 获取部门列表（根据登陆人筛选）
 * @param 
 */
export const getOutDeptListAll = () => {
  return request({
    url: '/basic/outDept/getOutDeptListAll',
    method: 'post'
  });
};

/**
 * 获取部门列表根据部门名称查下级
 * @param 
 */
export const getOutDepByName = (data: { deptName: string }) => {
  return request({
    url: '/basic/outDept/getOutDepByName',
    method: 'post',
    data
  });
};

/**
 * 获取部门列表（根据登陆人筛选）
 * @param 
 */
export const loginDeptList = () => {
  return request({
    url: '/system/dept/loginDeptList',
    method: 'get'
  });
};
// 获取部门列表
export function getSystemList(query: any) {
  return request({
    url: "/system/dept/queryList",
    method: "get",
    params: query,
  });
}

/**
 * 获取部门下的所有用户信息
 * @param deptId
 */
export const getUserById = (deptId: string) => {
  return request({
    url: '/system/user/queryList/dept/' + deptId,
    method: 'get',
  });
};

/**
 * 获取部门下的所有用户信息
 * @param deptId
 */
export const getUserList = (data: any) => {
  return request({
    url: '/basic/util/getUserList',
    method: 'get',
    params: data
  });
};


